package cn.iocoder.yudao.module.iot.service;

import cn.iocoder.yudao.module.iot.dal.dataobject.IotDataBridgeDO;
import cn.iocoder.yudao.module.iot.dal.mysql.IotDataBridgeMapper;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import java.util.List;

@Service
public class IotDataBridgeServiceImpl implements IotDataBridgeService {
    @Resource
    private IotDataBridgeMapper dataBridgeMapper;

    @Override
    public Long createDataBridge(IotDataBridgeDO dataBridge) {
        dataBridgeMapper.insert(dataBridge);
        return dataBridge.getId();
    }

    @Override
    public void updateDataBridge(IotDataBridgeDO dataBridge) {
        dataBridgeMapper.updateById(dataBridge);
    }

    @Override
    public void deleteDataBridge(Long id) {
        dataBridgeMapper.deleteById(id);
    }

    @Override
    public IotDataBridgeDO getDataBridge(Long id) {
        return dataBridgeMapper.selectById(id);
    }

    @Override
    public List<IotDataBridgeDO> getDataBridgeList() {
        return dataBridgeMapper.selectList(null);
    }
} 